// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.graphics.Color;
import android.os.Bundle;
import android.os.Handler;
import android.text.Editable;
import android.text.Html;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.TextView;
import com.nnee.p_b.p_b.p_f.cls_a;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_fk.cls_k;
import com.nnee.p_img.cls_c;
import com.nnee.p_img.cls_d;
import com.nnee.p_pr.p_a.cls_p;
import com.nnee.p_pr.p_activity.p_view.cls_AttachmentImageView;
import com.nnee.p_pr.p_atom.cls_b;
import com.nnee.p_pr.p_c.cls_l;
import com.nnee.p_pr.p_prov.cls_af;
import com.nnee.p_pr.cls_v;
import java.util.ArrayList;
import java.util.HashSet;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            ct, cw, cx, cu, 
//            ay, PRISActivityWBSetting, cv, cs

public class cls_PRISActivityForward extends cls_ActivityEx
    implements TextWatcher, android.view.View.OnClickListener
{

    public cls_PRISActivityForward()
    {
        j = false;
        G = cls_b.aNormal;
        a = new cls_ct(this);
        L = new ArrayList();
        M = null;
        N = null;
        O = -1;
        P = -1;
        b = new cls_cw(this);
        c = new cls_cx(this);
        Q = new HashSet();
    }

    static String a(cls_PRISActivityForward prisactivityforward, int i1)
    {
        return prisactivityforward.b(i1);
    }

    static String a(cls_PRISActivityForward prisactivityforward, String s1)
    {
        prisactivityforward.D = s1;
        return s1;
    }

    static StringBuilder a(cls_PRISActivityForward prisactivityforward)
    {
        return prisactivityforward.E;
    }

    private void a(int i1)
    {
        if(a != null)
            a.sendEmptyMessage(i1);
    }

    public static void a(Context context, String s1, String s2, String s3)
    {
        Intent intent = new Intent(context, com.nnee.p_pr.p_activity.cls_PRISActivityForward.class);
        intent.setAction("action_icon_forward");
        intent.putExtra("extra_icon_title", s1);
        intent.putExtra("extra_icon_url", s2);
        intent.putExtra("extra_from", s3);
        context.startActivity(intent);
    }

    public static void a(Context context, String s1, String s2, String s3, String s4, String s5, String s6, String s7, 
            cls_b b1)
    {
        Intent intent = new Intent(context, com.nnee.p_pr.p_activity.cls_PRISActivityForward.class);
        intent.setAction("action_comment_forward");
        intent.putExtra("extra_article_title", s1);
        intent.putExtra("extra_article_uid", s2);
        intent.putExtra("extra_comment_url", s3);
        intent.putExtra("extra_sharing_url", s4);
        intent.putExtra("extra_article_url", s5);
        intent.putExtra("extra_icon_url", s6);
        intent.putExtra("extra_from", s7);
        intent.putExtra("subscribe_source_type", b1.name());
        context.startActivity(intent);
    }

    private String b(int i1)
    {
        int j1 = 0;
        switch(i1)
        {
        case 1:
        	j1 = 0x7f0a011d;
        	break;
        case 2:
        	j1 = 0x7f0a011f;
        	break;
        case 3:
        	j1 = 0x7f0a011e;
        	break;
        case 4:
        	j1 = 0x7f0a0122;
        	break;
        case 5:
        	j1 = 0x7f0a0121;
        	break;
        case 6:
        	j1 = 0x7f0a0120;
        	break;
        case 7:
        	j1 = 0x7f0a0123;
        	break;
        default:
        	break;
        }
        
        return getString(j1);
        
    }

    static String b(cls_PRISActivityForward prisactivityforward)
    {
        return prisactivityforward.y;
    }

    static String b(cls_PRISActivityForward prisactivityforward, String s1)
    {
        prisactivityforward.N = s1;
        return s1;
    }

    static void b(cls_PRISActivityForward prisactivityforward, int i1)
    {
        prisactivityforward.a(i1);
    }

    static cls_AttachmentImageView c(cls_PRISActivityForward prisactivityforward)
    {
        return prisactivityforward.C;
    }

    static String c(cls_PRISActivityForward prisactivityforward, int i1)
    {
        return prisactivityforward.i(i1);
    }

    static void d(cls_PRISActivityForward prisactivityforward)
    {
        prisactivityforward.h();
    }

    static int e(cls_PRISActivityForward prisactivityforward)
    {
        return prisactivityforward.P;
    }

    private boolean e()
    {
        boolean flag;
        if(j && n != null && n.requery() && n.getCount() == 0)
        {
            if(n != null)
            {
                n.close();
                n = null;
            }
            finish();
            flag = true;
        } else
        {
            flag = false;
        }
        return flag;
    }

    static int f(cls_PRISActivityForward prisactivityforward)
    {
        return prisactivityforward.O;
    }

    private void f()
    {
        C = (cls_AttachmentImageView)findViewById(0x7f0d0086);
        q = (TextView)findViewById(0x7f0d0009);
        q.setBackgroundDrawable(com.nnee.p_fk.cls_k.a(this).b(0x7f020134));
        int i1 = getResources().getDimensionPixelSize(0x7f090005);
        ((LinearLayout)findViewById(0x7f0d0005)).setPadding(0, 0, i1, 0);
        q.setVisibility(0);
        q.setTextSize(14F);
        q.setTextColor(Color.rgb(255, 255, 255));
        q.setText(0x7f0a0156);
        setTitle(0x7f0a0156);
        g(8);
        r = (TextView)findViewById(0x7f0d0087);
        m = (CheckBox)findViewById(0x7f0d0088);
        if(B == 1 || u == null)
        {
            m.setChecked(false);
            m.setVisibility(8);
        }
        if(B == 1 && y != null)
        {
            D = com.nnee.p_img.cls_d.a().a(y);
            android.graphics.Bitmap bitmap = null;
            int j1 = com.nnee.p_img.cls_c.a(this, 56F);
            int k1 = com.nnee.p_img.cls_c.a(this, 56F);
            if(D != null)
                bitmap = com.nnee.p_pr.p_a.cls_p.a(D, j1, k1);
            if(bitmap != null)
            {
                C.setImageBitmap(bitmap);
                C.setVisibility(0);
            }
        }
        if(B == 0 && y != null)
        {
            E = new StringBuilder();
            if(!TextUtils.isEmpty(y))
                com.nnee.p_img.cls_d.a().a(E, 0, y, new cls_cu(this), 4, 0);
        }
        k = (ListView)findViewById(0x7f0d0089);
        k.setDividerHeight(1);
        l = (EditText)findViewById(0x7f0d0085);
        l.addTextChangedListener(this);
        l.setText(w);
        l.setSelected(true);
        l.setSelection(0);
        q.setOnClickListener(this);
        n = com.nnee.p_pr.p_c.cls_l.a(this);
        startManagingCursor(n);
        o = (TextView)findViewById(0x7f0d008a);
        o.setOnClickListener(this);
        p = new cls_ay(this, this, n);
        k.setAdapter(p);
        if(n != null && n.getCount() == 0)
            showDialog(2);
    }

    static HashSet g(cls_PRISActivityForward prisactivityforward)
    {
        return prisactivityforward.Q;
    }

    private void g()
    {
        finish();
    }

    private void h()
    {
        if(j)
            j = false;
        com.nnee.p_pr.p_activity.cls_PRISActivityWBSetting.a(this);
        j = true;
    }

    private String i(int i1)
    {String s1 = null;
        switch(i1)
        { 
        case 10002:
        	s1 = getString(0x7f0a0167);
        	break;
        case 10003:
        	s1 = getString(0x7f0a0168);
        	break;
         
        case 10006:
        	s1 = getString(0x7f0a0165);
        	break;
        case 10007:
        case 10008:
        	s1 = getString(0x7f0a0166);
        	break;
        case 10009:
        	 s1 = getString(0x7f0a0167);
        	break;
        case 10001:
        case 10004:
        case 10005:
        default:
        	break;
        }
         
        return s1;
 
    }

    private void r()
    {
        Cursor cursor;
        boolean flag = false;
        M = l.getText().toString().trim();
        boolean flag1;
        boolean flag2;
        String s1;
        String s2;
        boolean flag3;
        if(C.getVisibility() == 0)
            flag1 = true;
        else
            flag1 = flag;
        if(flag1 && C.a())
            flag2 = true;
        else
            flag2 = flag;
        s1 = p();
        s2 = F;
        if(!M.equals(w.trim()))
            flag = true;
        com.nnee.p_pr.p_d.cls_c.a(s1, s2, flag, flag2);
        if(B == 0 && m.isChecked() && !TextUtils.isEmpty(u))
            com.nnee.p_pr.cls_v.a().a(u, t, M);
        cursor = com.nnee.p_pr.p_c.cls_l.a(this);
        if(cursor == null) {
        	if(cursor != null)
                cursor.close();
        } else {
        	flag3 = cursor.moveToFirst();
            if(flag3) {
            	boolean flag4;
                do
                {
                    if(!Q.contains(Long.valueOf(cursor.getLong(0))))
                        L.add(Long.valueOf(cursor.getLong(0)));
                    flag4 = cursor.moveToNext();
                } while(flag4);
                if(cursor != null)
                    cursor.close();
                showDialog(1);
                if(B != 0)
                    {}
                else
                {
                if(G == cls_b.aNormal)
                {
                    O = com.nnee.p_pr.cls_v.a().g(t);
                   
                }
                }
               
                if(cursor != null)
                    cursor.close();
                
                if(!TextUtils.isEmpty(v))
                {
                    O = com.nnee.p_pr.cls_v.a().h(v);
                     
                }
                 
                if(B == 1 && !TextUtils.isEmpty(y))
                {
                    O = com.nnee.p_pr.cls_v.a().h(y);
                    
                }
                a(1);
            }
            else {
            	if(cursor != null)
                    cursor.close();
            }
        }
 
    }

    protected void a()
    {
        dismissDialog(1);
        finish();
    }

    public void afterTextChanged(Editable editable)
    {
        int i1 = editable.length();
        boolean flag;
        if(10 < 119 - i1)
        {
            z = 0;
            int k1 = com.nnee.p_fk.cls_k.a(this).c(0x7f08010a);
            Object aobj3[] = new Object[1];
            aobj3[0] = Integer.valueOf(k1);
            String s2 = String.format("#%06x", aobj3);
            Object aobj4[] = new Object[2];
            aobj4[0] = s2;
            aobj4[1] = Integer.valueOf(119 - i1);
            String s3 = getString(0x7f0a0158, aobj4);
            r.setText(Html.fromHtml(s3));
        } else
        if(119 - i1 >= 0 && 119 - i1 <= 10)
        {
            z = 0;
            int j1 = com.nnee.p_fk.cls_k.a(this).c(0x7f08010c);
            Object aobj1[] = new Object[1];
            aobj1[0] = Integer.valueOf(j1);
            String s1 = String.format("#%06x", aobj1);
            TextView textview1 = r;
            Object aobj2[] = new Object[2];
            aobj2[0] = s1;
            aobj2[1] = Integer.valueOf(119 - i1);
            textview1.setText(Html.fromHtml(getString(0x7f0a0159, aobj2)));
        } else
        if(119 - i1 < 0)
        {
            z = 1;
            TextView textview = r;
            Object aobj[] = new Object[1];
            aobj[0] = Integer.valueOf(i1 + -119);
            textview.setText(Html.fromHtml(getString(0x7f0a015a, aobj)));
        }
        if(n != null && Q != null)
        {
            if(n.getCount() <= Q.size())
                flag = true;
            else
                flag = false;
        } else
        {
            flag = true;
        }
        if(z == 1 || TextUtils.isEmpty(l.getEditableText().toString().trim()) || flag)
        {
            q.setEnabled(false);
            q.setTextColor(Color.rgb(153, 153, 153));
        } else
        {
            q.setEnabled(true);
            q.setTextColor(Color.rgb(255, 255, 255));
        }
    }

    protected void b()
    {
//    	String s2;
//        boolean flag;
//        String s1;
//        flag = false;
//        s1 = null;
//        if(B == 1 && C.a())
//            s1 = D;
//        if(B != 0) {
//        	s2 = s1;
//        	ArrayList arraylist = L;
//            
//            Cursor cursor;
//            if(L.size() <= 0)
//                return;
//            long l1 = ((Long)L.remove(-1 + L.size())).longValue();
//            cursor = getContentResolver().query(ContentUris.withAppendedId(cls_af.k, l1), cls_l.a, null, null, null);
//            if(cursor != null && cursor.moveToFirst()) {
//            	if(TextUtils.isEmpty(N)) {
//            		 s3 = M;
//                     goto _L9
//            	} else goto _L6
//            } else {
//            	 a(1);
//            	 
//            	 if(cursor != null)
//                     cursor.close();
//         
//                 return;
//            }
//        } else {
//        	if(C.getVisibility() == 0)
//                flag = true;
//            if(!flag || !C.a()) goto _L2; else goto _L3
//        }
//_L1:
//        if(C.getVisibility() == 0)
//            flag = true;
//        if(!flag || !C.a()) goto _L2; else goto _L3
//_L3:
//        
//        if(D == null)
//            D = com.nnee.p_img.cls_d.a().a(y);
//        s2 = D;
//_L13:
//        
//_L4:
//        a(1);
//_L8:
//        if(cursor != null)
//            cursor.close();
//_L11:
//        arraylist;
//        JVM INSTR monitorexit ;
//        return;
//_L5:
//        if(TextUtils.isEmpty(N)) goto _L7; else goto _L6
//_L6:
//        String s3 = (new StringBuilder()).append(M).append(" ").append(N).toString();
//_L9:
//        String s7;
//        P = cursor.getInt(4);
//        if(B == 0 && !TextUtils.isEmpty(x))
//            com.nnee.p_pr.cls_v.a().a(x, t, "", P);
//        if(P != 5)
//            break MISSING_BLOCK_LABEL_438;
//        if(!TextUtils.isEmpty(s))
//            break MISSING_BLOCK_LABEL_429;
//        s7 = getString(0x7f0a01e8);
//_L10:
//        Exception exception;
//        com.nnee.b.b.d.cls_c c1;
//        String s4;
//        com.nnee.p_b.p_b.p_e.cls_d d1;
//        com.nnee.b.b.g.c c2;
//        String s5;
//        com.nnee.p_b.p_b.p_e.cls_d d2;
//        cls_a a1;
//        String s6;
//        com.nnee.p_b.p_b.p_e.cls_d d3;
//        String s8;
//        String s9;
//        if(s7.length() > 30)
//            s8 = s7.substring(0, 30);
//        else
//            s8 = s7;
//        s9 = v;
//        if(TextUtils.isEmpty(s9))
//            s9 = y;
//        com.nnee.p_g.cls_b.c("PrisactivityForward", (new StringBuilder()).append("title:").append(s8).append("url: ").append(s9).toString());
//        com.nnee.p_b.p_b.p_a.cls_b.a().a(cursor.getString(2), s3, null, b);
//          goto _L8
//        exception;
//        throw exception;
//_L7:
//        s3 = M;
//          goto _L9
//        s7 = s;
//          goto _L10
//        if(P == 1)
//        {
//            a1 = com.nnee.p_b.p_b.p_f.cls_a.a();
//            s6 = cursor.getString(2);
//            d3 = b;
//            a1.a(s6, s3, s2, null, null, null, d3);
//        } else
//        if(P == 3)
//        {
//            c2 = com.nnee.p_b.p_b.p_g.cls_c.a();
//            s5 = cursor.getString(2);
//            d2 = b;
//            c2.a(s5, s3, s2, null, null, d2);
//        } else
//        if(P == 4)
//            com.nnee.p_b.p_b.p_b.cls_a.a().a(cursor.getString(2), s3, s2, b);
//        else
//        if(P == 2)
//        {
//            c1 = com.nnee.p_b.p_b.p_d.cls_c.a();
//            s4 = cursor.getString(2);
//            d1 = b;
//            c1.a(s4, s3, s2, null, null, d1);
//        } else
//        if(P == 6)
//            com.nnee.p_b.p_b.p_c.cls_a.a().a(cursor.getString(2), s3, s2, b);
//        else
//        if(P == 7)
//            com.nnee.p_b.p_b.p_h.cls_d.a().a(cursor.getString(2), s3, null, null, null, null, null, null, s2, null, b);
//          goto _L8
//        a(2);
//          goto _L11
//_L2:
//        s2 = s1;
//        if(true) goto _L13; else goto _L12
//_L12:
    }

    public void beforeTextChanged(CharSequence charsequence, int i1, int j1, int k1)
    {
    }

    protected void c()
    {
        if(n.getCount() > 0)
        {
            if(n.getCount() > Q.size())
            {
                if(z == 1 || TextUtils.isEmpty(l.getEditableText().toString().trim()))
                {
                    q.setEnabled(false);
                    q.setTextColor(Color.rgb(153, 153, 153));
                } else
                {
                    q.setEnabled(true);
                    q.setTextColor(Color.rgb(255, 255, 255));
                }
            } else
            {
                q.setEnabled(false);
                q.setTextColor(Color.rgb(153, 153, 153));
            }
        } else
        {
            q.setEnabled(false);
            q.setTextColor(Color.rgb(153, 153, 153));
        }
    }

    public void onClick(View view)
    {
        switch(view.getId())
        {
        case 2131558409:
        	r();
        	break;
        case 2131558538:
        	h();
            com.nnee.p_pr.p_d.cls_c.a(p(), 722);
        	break;
        default:
        	break;
        	
        }
    
    }

    protected void onCreate(Bundle bundle)
    {
        String s1;
        super.onCreate(bundle);
        setContentView(0x7f03002a);
        s1 = getIntent().getAction();
        if(!TextUtils.isEmpty(s1)) {
        	if(!s1.equals("action_comment_forward")) {
        		if(!s1.equals("action_icon_forward"))
                    return;
                B = 1;
                s = getIntent().getStringExtra("extra_icon_title");
                y = getIntent().getStringExtra("extra_icon_url");
                Object aobj[] = new Object[1];
                String s2;
                if(s == null)
                    s2 = "";
                else
                    s2 = s;
                aobj[0] = s2;
                w = getString(0x7f0a0157, aobj);
                F = getIntent().getStringExtra("extra_from");


               
                
        	} else {
        		B = 0;
                Intent intent = getIntent();
                s = intent.getStringExtra("extra_article_title");
                t = intent.getStringExtra("extra_article_uid");
                u = intent.getStringExtra("extra_comment_url");
                v = intent.getStringExtra("extra_article_url");
                x = intent.getStringExtra("extra_sharing_url");
                Object aobj1[] = new Object[1];
                String s3;
                if(s == null)
                    s3 = "";
                else
                    s3 = s;
                aobj1[0] = s3;
                w = getString(0x7f0a0157, aobj1);
                y = intent.getStringExtra("extra_icon_url");
                F = intent.getStringExtra("extra_from");
                G = com.nnee.p_pr.p_atom.cls_b.valueOf(intent.getStringExtra("subscribe_source_type"));
        	}
        	
        	 z = 0;
             f();
             com.nnee.p_pr.cls_v.a().a(c);
        } else {
        	finish();
        }

    }

    protected Dialog onCreateDialog(int i1)
    {
    	Object obj  ;
       switch( i1){
       case 1:
    	   obj = new ProgressDialog(this);
           ((ProgressDialog) (obj)).setMessage(getString(0x7f0a015c));
    	   break;
       case 2:
    	   obj = (new android.app.AlertDialog.Builder(this)).setIcon(0x7f02008b).setTitle(0x7f0a00fe).setMessage(0x7f0a00ff).setPositiveButton(0x7f0a0100, new cls_cv(this)).create();
           ((Dialog) (obj)).setOnDismissListener(new cls_cs(this));
    	   break;
       default:
    	     obj = super.onCreateDialog(i1);
    	   break;
       }
   
    }

    protected void onDestroy()
    {
        if(E != null)
            E.setLength(0);
        com.nnee.p_pr.cls_v.a().b(c);
        if(n != null)
        {
            n.close();
            n = null;
        }
        if(L != null)
        {
            L.clear();
            L = null;
        }
        if(a != null)
        {
            a.removeMessages(1);
            a.removeMessages(2);
            a = null;
        }
        super.onDestroy();
    }

    protected void onResume()
    {
        super.onResume();
        if(!e())
        {
            if(l.length() > 0)
                l.setSelection(0, 0);
            c();
        }
    }

    public void onTextChanged(CharSequence charsequence, int i1, int j1, int k1)
    {
    }

    private static final int H = 1;
    private static final int I = 2;
    private static final int J = 1;
    private static final int K = 2;
    private static final String d = "PRISActivityForward";
    private static final int e = 119;
    private static final int f = 0;
    private static final int g = 1;
    private static final int h = 0;
    private static final int i = 1;
    private Button A;
    private int B;
    private cls_AttachmentImageView C;
    private String D;
    private StringBuilder E;
    private String F;
    private cls_b G;
    private ArrayList L;
    private String M;
    private String N;
    private int O;
    private int P;
    private HashSet Q;
    Handler a;
    com.nnee.p_b.p_b.p_e.cls_d b;
    com.nnee.p_pr.cls_b c;
    private boolean j;
    private ListView k;
    private EditText l;
    private CheckBox m;
    private Cursor n;
    private TextView o;
    private cls_ay p;
    private TextView q;
    private TextView r;
    private String s;
    private String t;
    private String u;
    private String v;
    private String w;
    private String x;
    private String y;
    private int z;
}
